﻿


	$(document).ready(function() {
	
		positionFooter();
        
        $(window)
          .scroll(positionFooter)
          .resize(positionFooter);
        
        function positionFooter() {
          var docHeight = $(document.body).height() - $("#sticky-footer-push").height();
          if(docHeight < $(window).height()){
            var diff = $(window).height() - docHeight;
            if (!$("#sticky-footer-push").length > 0) {
              $("#general_footer").before('<div id="sticky-footer-push"></div>');
            }
            $("#sticky-footer-push").height(diff);
          } 
        }	

	/* handle the user selections */
	$(".checklist .checkbox-select").click(
		function(event) {
			event.preventDefault();
			$(this).parent().addClass("selected");
			$(this).parent().find(":checkbox").attr("checked","checked");
			var cat = $(this).parent().find(":checkbox").attr("id");
			if (cat=="app"){
			var newlatlng = new google.maps.LatLng(51.056151,3.724555);
			map.panTo(newlatlng);
			map.setZoom(15);
			}
			else
			{
			show(cat);
			}			
		}
	);
	
	$(".checklist .checkbox-deselect").click(
		function(event) {
			event.preventDefault();
			$(this).parent().removeClass("selected");
			$(this).parent().find(":checkbox").removeAttr("checked");
			var cat = $(this).parent().find(":checkbox").attr("id");
			if (cat=="app"){
			var newlatlng = new google.maps.LatLng(51.056151,3.724555);
			map.panTo(newlatlng);
			map.setZoom(15);
			}
			else
			{
			hide(cat);
			}
		}
	);
	
					var url_path=(window.location.pathname.split("/")[1]);
				if (url_path == "en")
				{
					var your_residence="Your residence";
				}
				else if (url_path == "fr")
				{
					var your_residence="Votre lieu de séjour ";
				}
				else
				{
					var your_residence="Uw verblijfplaats";
				}	
	


    var locations = [
      [your_residence, 'app', 51.050787, 3.726001, true , 'www.koestraat46.be'],
      ['Sint Baafskathedraal', 'monument' , 51.053096,3.726339, false, 'www.sintbaafskathedraal.be'],
      ['Stadhuis', 'monument' ,51.054191,3.725288, false,'www.gent.be'], 
      ['Stadshal', 'monument' ,51.054042,3.724778, false], 
      ['Belfort', 'monument' ,51.053649,3.72503, false,'www.belfortgent.be'], 
      ['Sint Niklaaskerk', 'monument' ,51.054034,3.722302, false,'www.stniklaas.com'], 
      ['Korenmarkt', 'monument' ,51.054597,3.721964, false], 
      ['Graslei', 'monument' ,51.054439,3.720688, false ], 
      ['Infokantoor Toerisme Gent', 'monument' ,51.056509,3.721262, false,'www.visitgent.be'], 
      ['Vrijdagsmarkt', 'monument' ,51.057001,3.725701, false,'www.vrijdagmarkt.org'], 
      ['Sint Jacobskerk', 'monument' ,51.056504,3.727066, false], 
      ['Portus Ganda', 'monument' ,51.053737,3.734181, false,'www.portusganda.be'], 
      ['Sint-Baafsabdij', 'monument' ,51.052908,3.735607, false,'www.burenvandeabdij.be'], 
      ['Begijnhof', 'monument' ,51.046213,3.736043, false], 
      ['Geraard Duivelsteen', 'monument' ,51.051808,3.728258, false,'www.duivelsteen.be'], 
      ['Kouter', 'monument' ,51.05023,3.723763, false], 
      ['Zuidpark', 'monument' ,51.045859,3.731777, false], 
      ['Patershol', 'monument' ,51.058033,3.722471, false,'www.patershol.org'], 
      ['Groentenmarkt', 'monument' ,51.055807,3.72217, false],
      ['Gravensteen', 'monument' ,51.056927,3.721312, false],
      ['Korenlei', 'monument' ,51.05427,3.720148, false],
      ['Prinsenhof', 'monument' , 51.059034,3.715899, false],
      ['Keizer Karel Brug', 'monument' , 51.059329,3.717005, false],
      ['Rabot', 'monument' , 51.060366,3.713249, false] ,      
      ['Groot Begijnhof', 'monument' , 51.056735,3.748011, false,'www.grootbegijnhof.be'] ,
      ['Oud Begijnhof', 'monument' , 51.057095,3.712551, false],
      ['STAM', 'musea' , 51.043310, 3.716849, false,'www.stamgent.be'],
      ['Museum voor Schone Kunsten', 'musea' , 51.038112, 3.724129, false,'www.mskgent.be'],
      ['S.M.A.K.', 'musea' , 51.03819, 3.723922, false,'www.smak.be'],
      ['Kunsthal Sint-Pietersabdij', 'musea' , 51.042851, 3.726508, false,'www.sintpietersabdijgent.be'],
      ['De Wereld van Kina', 'musea' , 51.043134, 3.726508, false,'www.dewereldvankina.be'],
      ['De Wereld van Kina', 'musea' , 51.064203, 3.725735, false,'www.dewereldvankina.be'],
      ['Design museum Gent', 'musea' , 51.055666, 3.720113, false,'design.museum.gent.be'],
      ['MIAT', 'musea' , 51.059773, 3.729367, false,'www.miat.gent.be'],
      ['Het Huis van Alijn', 'musea' , 51.057337, 3.723329, false,'www.huisvanalijn.be'],
      ['Gravensteen', 'musea' , 51.056753, 3.720594, false],
      ['Museum Dr. Guislain', 'musea' , 51.066288, 3.7031, false,'www.museumdrguislain.be'],
      ['Belfort', 'musea' , 51.053535, 3.725263, false,'www.belfortgent.be'],
      ['Sint-Baafskathedraal', 'musea' , 51.053026, 3.726642, false,'www.sintbaafskathedraal.be'],
      ['Pink Flamingo s', 'bars' , 51.055909, 3.725094, false,'www.pinkflamingos.be'],
      ['Cafe den Turk', 'bars' , 51.054428, 3.72554, false,'cafedenturk.be'],
      ['t Dreupelkot', 'bars' , 51.0566, 3.72215, false,'www.dreupelkot.be'],
      ['Galgenhuisje', 'bars' , 51.056602, 3.725314, false],
	    ['Charlatan', 'bars' , 51.05592723771851,3.7285253405570984, false,'charlatan.be'],
      ['Het Spijker', 'bars' , 51.05554171731442, 3.721367107179952, false,'www.cafehetspijker.be'],
      ['Limonada', 'bars' , 51.05306100417818, 3.724021165128479, false],
      ['Bar des Amis', 'bars' , 51.05608740110912, 3.7284287810325623, false,'www.bardesamis.be'],
      ['Dulle Griet', 'bars' , 51.05675744550877, 3.7255266671951643, false,'www.dullegriet.be'],
      ['Damberd', 'bars' , 51.054709, 3.721877, false,'www.damberd.be'],
      ['Manteca', 'bars' , 51.05387583528202, 3.7229302403332536, false],
      ['Het Waterhuis aan de Bierkant', 'bars' , 51.05639933943426, 3.722427585319565, false,'www.waterhuisaandebierkant.be'],
      ['Jiggers', 'bars' , 51.05789620822296, 3.72427333006713, false,'www.jiggers.be'],
      ['Abacho', 'bars' , 51.0555253858019, 3.723016435571279, false,'www.abachobar.be'],
      ['Bar Jos', 'bars' , 51.05584682828662, 3.72829971537857, false],
      ['The Out', 'bars' , 51.05490202069761, 3.724780106267892, false,'www.the-out.com'],
      ['K27', 'bars' , 51.057345085952214, 3.725910186767578, false,'www.k27.be'],
      ['Misterioso', 'bars' , 51.059124, 3.726615, false,'www.misterioso.be'],
      ['De Maecht van Ghent', 'bars' , 51.054704, 3.721943, false,'www.maechtvanghent.be'],
      ['Sphinx Cafe', 'bars' , 51.05410821316544, 3.7215843615518267, false,'www.sphinx-cinema.be/cafe/info/democratisch-stadscafe'],
      ['Cafe Rococo', 'bars' , 51.057877821510765, 3.723163604736328, false],
      ['De Trollekelder', 'bars' , 51.056226499999994, 3.7275034189224243, false,'www.detrollekelder.be'],
      ['Vijf Voor Twaalf', 'bars' , 51.054591134685054, 3.7218495545064227, false,'www.vijfvoortwaalf.be'],
      ['Tijuana', 'bars' , 51.05354158058528, 3.7217366695404053, false,'www.tijuana.be'],
      ['Gloria', 'bars' , 51.056076, 3.72796, false],
      ['White Cat', 'bars' , 51.05933714916874, 3.7236067850766945, false,'www.whitecat.be'],
      ['A-Pluss', 'bars' , 51.055703738564915, 3.7272247422018068, false],
      ['Barrazza', 'bars' , 51.05680498185948, 3.723090099556199, false,'www.barrazza.be'],
      ['Cafe De Zoo', 'bars' , 51.057794, 3.723936080932617, false,'www.deachtzaligheden.be/#/nl/cafe-de-zoo'],
      ['Minor Swing', 'bars' , 51.058923, 3.726632, false],
      ['NTGent Foyer', 'bars' , 51.05339995467174, 3.725738525390625, false,'www.foyerntgent.be'],
      ['Bij de vieze gasten', 'cultuur' , 51.058385, 3.702215, false,'www.deviezegasten.org'],
      ['Capitole', 'cultuur' , 51.048166, 3.732258, false,'www.capitolegent.be'],
      ['De Bijloke', 'cultuur' , 51.045615, 3.718504, false,'www.debijloke.be'],
      ['de CENTRALE', 'cultuur' , 51.061268, 3.734383, false,'www.decentrale.be'],
      ['De Cultuurloft', 'cultuur' , 51.039443, 3.731929, false,'www.decultuurloft.be'],
      ['DOK', 'cultuur' , 51.058105, 3.739761, false,'dokgent.be/'],
      ['Handelsbeurs', 'cultuur' , 51.049798, 3.722997, false,'www.handelsbeurs.be'],
      ['Het KIP', 'cultuur' , 51.061888, 3.724589, false,'www.hetkip.be'],
      ['Hotsy Totsy', 'cultuur' , 51.054449, 3.716544, false,'www.hotsytotsy.be'],
      ['Kopergieterij', 'cultuur' , 51.059597, 3.732433, false,'www.kopergietery.be'],
      ['Kopergieterij Rabot', 'cultuur' , 51.063589, 3.711533, false,'www.kopergietery.be'],
      ['Vooruit', 'cultuur' , 51.047694, 3.727624, false,'vooruit.be/'],
      ['Minard', 'cultuur' , 51.0488, 3.727562, false,'www.minard.be'],
      ['NTGent', 'cultuur' , 51.053535, 3.725778, false,'www.foyerntgent.be'],
      ['Sphinx', 'cultuur' , 51.053805, 3.721439, false,'www.sphinx-cinema.be'],
      ['Studio Skoop', 'cultuur' , 51.048854, 3.733887, false,'www.studioskoop.be'],
      ['Teater Tinnenpot', 'cultuur' , 51.058341, 3.718319, false,'www.tinnenpot.be'],
      ['Theaterplatform Scala', 'cultuur' , 51.053643, 3.744425, false,'www.scalaplatform.be'],
      ['Trefpunt', 'cultuur' , 51.0562, 3.727192, false,'www.trefpunt.be'],
      ['Vlaamse Opera', 'cultuur' , 51.049839, 3.722324, false,'vlaamseopera.be/nl'],
      ['Zebrastraat', 'cultuur' , 51.039734, 3.733741, false,'www.zebrastraat.be'],
      ['Belga Queen', 'restaurants' , 51.054904, 3.72092, false,'www.belgaqueen.be'] ,   
      ['Brasserie Pakhuis', 'restaurants' , 51.053376, 3.721596, false,'www.pakhuis.be'],
      ['Il Mezzogiorno', 'restaurants' , 51.059226, 3.729717, false,'www.ilmezzogiorno.be'],
      ['Per Bacco', 'restaurants' , 51.054277, 3.730361, false,'www.perbacco.be'],
      ['Cafe Theatre', 'restaurants' , 51.049667, 3.721436, false,'www.cafetheatre.com'],
      ['Jan Van den Bon', 'restaurants' , 51.039775, 3.718984, false,'www.janvandenbon.be'],
      ['Restaurant C-Jean', 'restaurants' , 51.054179, 3.724035, false,'www.c-jean.com'],
      ['De 3 Biggetjes', 'restaurants' , 51.057918, 3.721612, false,'www.de3biggetjes.com'],
      ['Nzet', 'restaurants' , 51.058734, 3.724373, false,'www.nzet.be'],
      ['Steendam 66', 'restaurants' , 51.057126, 3.730461, false,'www.steendam66.be'],
      ['Domestica', 'restaurants' , 51.051711, 3.719784, false,'www.domestica.be'],
      ['A Food Affair', 'restaurants' , 51.051053, 3.722927, false,'www.afoodaffair.be'],
      ['Grade', 'restaurants' , 51.041077, 3.721274, false,'www.grade.be'],
      ['Atmytable', 'restaurants' , 51.054499, 3.730233, false,'www.thekitchenbitch.be'],
      ['Les Tartes de Francoise', 'restaurants' , 51.050852, 3.728302, false,'www.tartes.be'],
      ['Yuzu', 'restaurants' , 51.049046, 3.727036, false],
      ['Zwaenepoel', 'restaurants' , 51.054833, 3.722656, false],
      ['Huis Diegenan', 'restaurants' , 51.041208, 3.736416, false],
      ['Kaas Mekka', 'restaurants' , 51.05125, 3.725642, false],
      ['De Vis', 'restaurants' , 51.052267, 3.723484, false,'www.devis.be'],
      ['Max', 'restaurants' , 51.054439, 3.723748, false],
      ['Tierenteyn-Verlent', 'restaurants' , 51.055637, 3.722391, false,'www.tierenteyn-verlent.be '],
      ['Mosquito Coast', 'restaurants' , 51.055282, 3.723479, false,'www.mosquitocoast.be'],
      ['Du Progres', 'restaurants' , 51.054688, 3.722224, false,'www.duproges.be'],
      ['Vintage', 'restaurants' , 51.051316, 3.719628, false,'www.vintagewine.be'],
      ['Bord eau', 'restaurants', 51.056903, 3.721589, false,'www.oudevismijn.be'],
      ['Greenway', 'restaurants' , 51.047623, 3.721602, false,'www.greenway.be'],
      ['Komkommertijd', 'restaurants' , 51.053255, 3.730356, false,'www.komkommertijd.be'],
      ['Mineral', 'restaurants' , 51.051778, 3.719741, false,'www.demineral.be'],
      ['J.E.F.', 'restaurants', 51.058727, 3.721283, false,'www.j-e-f.be'],
      ['The House of Eliott', 'restaurants' , 51.056563, 3.719842, false,'www.thehouseofeliott.be'],
      ['Groot Vleeshuis', 'restaurants' , 51.055922, 3.721886, false,'www.grootvleeshuis.be'],
      ['Korenlei Twee', 'restaurants' , 51.05544, 3.720283, false,'www.korenleitwee.be'],
      ['Lof', 'restaurants' , 51.054653, 3.715216, false,'www.restaurantlof.be']
];
	


    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 15,
      center: new google.maps.LatLng(51.056151,3.724555),
      mapTypeId: google.maps.MapTypeId.ROADMAP,
	  scrollwheel: false 
    });
	
	var monument = new google.maps.MarkerImage('/Images/monument_active.png',
      new google.maps.Size(32, 37),
      new google.maps.Point(0,0),
      new google.maps.Point(16, 36));
	    		

	var app = new google.maps.MarkerImage('/Images/app.png',
      new google.maps.Size(32, 37),
      new google.maps.Point(0,0),
      new google.maps.Point(16, 36));
	  
	var musea = new google.maps.MarkerImage('/Images/musea_active.png',
      new google.maps.Size(32, 37),
      new google.maps.Point(0,0),
      new google.maps.Point(16, 36));	  
  
   var bars = new google.maps.MarkerImage('/Images/bars_active.png',
      new google.maps.Size(32, 37),
      new google.maps.Point(0,0),
      new google.maps.Point(16, 36));
      
   var restaurants = new google.maps.MarkerImage('/Images/restaurants_active.png',
      new google.maps.Size(32, 37),
      new google.maps.Point(0,0),
      new google.maps.Point(16, 36));
      
   var cultuur = new google.maps.MarkerImage('/Images/cultuur_active.png',
      new google.maps.Size(32, 37),
      new google.maps.Point(0,0),
      new google.maps.Point(16, 36));   

    var infowindow = new google.maps.InfoWindow();
	
    var marker, i;
	
	var markers = new Array(); 		

    for (i = 0; i < locations.length; i++) {  
	

	
      marker = new google.maps.Marker({
        position: new google.maps.LatLng(locations[i][2], locations[i][3]),
        map: map,
		icon: eval((locations[i][1])),
		title:(locations[i][0]),
		visible:(locations[i][4])
        
      });
	          
      markers.push(marker);
	  

        
      google.maps.event.addListener(marker, 'click', (function(marker, i) {
        return function() {
		
			  		 var boxText = document.createElement("div");
			boxText.style.cssText = "font: 1em Verdana, Arial, Helvetica, sans-serif;margin-top: 9px;;padding: 0;line-height: 12px;";
			if (locations[i][5] != undefined){
			boxText.innerHTML = locations[i][0] + "<br><br>" + "<a href=http://"+ locations[i][5] +">http://"+ locations[i][5] +"</a>";}
			else {
			boxText.innerHTML = locations[i][0] ;
			}
		
          infowindow.setContent(boxText);
          infowindow.open(map, marker);
        }
      })(marker, i));
    }	

    // == shows all markers of a particular category, and ensures the checkbox is checked ==
      function show(category) {
        for (var i=0; i<locations.length; i++) {
          if (locations[i][1] == category) {
            markers[i].setVisible(true);
          }
        }
      }

      // == hides all markers of a particular category, and ensures the checkbox is cleared ==
      function hide(category) {
        for (var i=0; i<locations.length; i++) {
          if (locations[i][1] == category) {
            markers[i].setVisible(false);
          }
        }
      }
  	});	
